from dolfin import *
            
parameters["form_compiler"]["optimize"] = True    # true does not work, false works

mesh = UnitSquare(1,1)
V = VectorFunctionSpace(mesh,'DG',0)

v = Function(V)
phi = TestFunction(V)

w = conditional(gt(1,0),v,v)
l = inner(w,phi)*dx

assemble(l)                                       # <-- 

